package com.hangim.pce.common.search.repository;

import com.hangim.pce.common.search.domain.ESDrug;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

public interface ESDrugRepository extends ElasticsearchRepository<ESDrug, Long> {
    @Query("{\"query_string\":{\"query\":\"?0\",\"fields\":[\"name\",\"nameAlias\",\"spell\"]}}")
    Page<ESDrug> findDrugForPage(String q, Pageable pageable);

}
